package com.coder520.user.service;

import com.coder520.user.dao.UserMapper;
import com.coder520.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by PC on 2017/7/29.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int creatUser(User user) {
        return userMapper.insertSelective(user);
    }

    /**
     * @Author jinpengshen [www.coder520.com]
     * @Date 2017/7/30 21:29
     * @Description 根据用户名查找用户
     */
    @Override
    public User findUserByName(String username) {
        User user = userMapper.selectByUsername(username);
        return user;
    }
}
